package com.netty.gui.swt;

import java.awt.*;

/**
 * Description:
 *
 * @author: StriverFeng
 * @date: 2018-10-4
 * Details:
 */
public class MyFrame extends Frame {
    public static void main(String[] args) {
        MyFrame mf = new MyFrame();
        mf.setSize(500, 500);
        mf.setBackground(Color.red);
        mf.setLocation(100, 100);

        Panel p = new Panel();
        p.setBackground(Color.black);

        Button b = new Button("Test");
        b.setBackground(Color.red);
        p.add(b);

        TextField t1 = new TextField();
        t1.setSize(10, 20);
        p.add(t1);
        Canvas c1=new MyCanvas();
        c1.setSize(100,100);
        c1.setBackground(Color.CYAN);
        p.add(c1);

        mf.add(p);
        mf.setVisible(true);
    }

}
class MyCanvas extends Canvas{
    @Override
    public void paint(Graphics g) {
        g.setColor(Color.YELLOW);
        g.drawLine(1,1,10,10);
        g.setColor(Color.CYAN);
        g.draw3DRect(20,20,40,40,true);
    }
}
